package my.edu.model.information.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Null;
import lombok.Data;
import my.edu.common.validate.groups.Insert;
import my.edu.common.validate.IntegerPattern;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("route")
public class Route {
    @TableId(type = IdType.AUTO)
    @Null(message = "id必须为空",groups = Insert.class)
    private Long id;
    @NotBlank(message = "编号不能为空")
    private String routeNo;
    @NotBlank(message = "编号名称不能为空")
    private String routeName;
    @IntegerPattern(regexp = "^[01]$", message = "状态参数错误")
    private Integer status;
    @IntegerPattern(regexp = "^[01]$", message = "是否默认线路参数错误")
    private Integer isDefault;
    private String deliveryPersonName;
    private String licensePlate;//车牌号
    private String vehicleType;//车类型
    private BigDecimal loadCapacity;//载重
    private String remark;
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    @TableField(fill = FieldFill.UPDATE)
    private Long updatedBy;
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT)
    private Long createdBy;
}